package com.spzx.JUC2.test7;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorsDemo03 {

    public static void main(String[] args) {
        ExecutorService threadPool = Executors.newFixedThreadPool(5);
        for (int i = 0; i < 10; i++) {

            threadPool.submit(()->System.out.println(Thread.currentThread().getName()+ "执行了任务"));

        }

        threadPool.shutdown();
    }
}
